home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / alloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  2.5 KB  |  121 lines

  1. /*  alloc.h
  2.  
  3.     memory management functions and variables.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 9.0
  9.  *
  10.  *      Copyright (c) 1987, 1998 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14. /* $Revision:   9.3  $ */
  15.  
  16. #if !defined(__ALLOC_H)
  17. #define __ALLOC_H
  18.  
  19. #ifndef ___STDDEF_H
  20. #include <_stddef.h>
  21. #endif
  22.  
  23. #if !defined(RC_INVOKED)
  24.  
  25. #if defined(__STDC__)
  26. #pragma warn -nak
  27. #endif
  28.  
  29. #endif  /* !RC_INVOKED */
  30.  
  31. #ifdef __cplusplus
  32. namespace std {
  33. #endif
  34.  
  35. #if !defined(__STDC__)
  36. struct heapinfo
  37. {
  38.   void *    ptr;
  39.   void *    ptr2;
  40.   unsigned  size;
  41.   int       in_use;
  42. };
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. void *   _RTLENTRY _EXPFUNC calloc(_SIZE_T __nitems, _SIZE_T __size);
  50. void     _RTLENTRY _EXPFUNC free(void * __block);
  51. void *   _RTLENTRY _EXPFUNC malloc(_SIZE_T  __size);
  52. void *   _RTLENTRY _EXPFUNC realloc(void * __block, _SIZE_T __size);
  53. int      _RTLENTRY _EXPFUNC heapcheck(void);
  54. int      _RTLENTRY _EXPFUNC heapfillfree(unsigned int __fillvalue);
  55. int      _RTLENTRY _EXPFUNC heapcheckfree(unsigned int __fillvalue);
  56. int      _RTLENTRY _EXPFUNC heapchecknode(void *__node);
  57. int      _RTLENTRY _EXPFUNC heapwalk(struct heapinfo *__hi);
  58.  
  59. #if defined(__DPMI32__)
  60. unsigned _RTLENTRY          coreleft(void);
  61. #endif
  62.  
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66.  
  67. /* Values returned by heap??? and _heap??? functions */
  68.  
  69. #define _HEAPEMPTY      1
  70. #define _HEAPOK         2
  71. #define _FREEENTRY      3
  72. #define _USEDENTRY      4
  73. #define _HEAPEND        5
  74. #define _HEAPCORRUPT    -1
  75. #define _BADNODE        -2
  76. #define _BADVALUE       -3
  77. #define _HEAPBADBEGIN   -4
  78. #define _HEAPBADNODE    -5
  79. #define _HEAPBADPTR     -6
  80.  
  81. #if !defined(__STDC__)
  82. #define farcalloc   calloc
  83. #define farcoreleft coreleft
  84. #define farfree     free
  85. #define farmalloc   malloc
  86. #define farrealloc  realloc
  87. #endif
  88.  
  89. #if !defined(RC_INVOKED)
  90.  
  91. #if defined(__STDC__)
  92. #pragma warn .nak
  93. #endif
  94.  
  95. #endif  /* !RC_INVOKED */
  96.  
  97. #ifdef __cplusplus
  98. } // std
  99. #endif
  100.  
  101. #endif  /* __ALLOC_H */
  102.  
  103.  
  104. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__ALLOC_H_USING_LIST)
  105. #define __ALLOC_H_USING_LIST
  106.     using std::calloc;
  107.     using std::free;
  108.     using std::malloc;
  109.     using std::realloc;
  110. #if !defined(__STDC__)
  111.     using std::heapinfo;
  112. #endif
  113.     using std::heapcheck;
  114.     using std::heapfillfree;
  115.     using std::heapcheckfree;
  116.     using std::heapchecknode;
  117.     using std::heapwalk;
  118. #   if defined(__DPMI32__)
  119.         using std::coreleft;
  120. #   endif
  121. #endif /* __USING_CNAME__ */